]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid/iconGrid: Hook page-padding with CSS
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 25 Nov 2020 21:42:03 +0000 (18:42 -0300)
committerMarge Bot <marge-bot@gnome.org>
Tue, 1 Dec 2020 18:57:49 +0000 (18:57 +0000)
Add support for setting the page padding of the icon grid
through CSS. Unfortunately, each side needs to be specificied
manually, since it's not a regular padding property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1510>

js/ui/iconGrid.js

index 4095299504bac76bdab689a30c2470a2e02743d2..51157a311c48d9015c4b315097c2a1162661ff93 100644 (file)
@@ -1311,6 +1311,7 @@ var IconGrid = GObject.registerClass({
             columns_per_page: 6,
             rows_per_page: 4,
             page_halign: Clutter.ActorAlign.CENTER,
+            page_padding: new Clutter.Margin(),
             page_valign: Clutter.ActorAlign.CENTER,
             last_row_align: Clutter.ActorAlign.START,
             column_spacing: 0,
@@ -1442,6 +1443,12 @@ var IconGrid = GObject.registerClass({
 
         [found, value] = node.lookup_length('max-row-spacing', false);
         this.layout_manager.max_row_spacing = found ? value : -1;
+
+        const padding = new Clutter.Margin();
+        ['top', 'right', 'bottom', 'left'].forEach(side => {
+            padding[side] = node.get_length(`page-padding-${side}`);
+        });
+        this.layout_manager.page_padding = padding;
     }
 
     /**